/**
  ETFRoot project, Anyang Normal University && IMP-CAS

  \class ETFRawChannel
  \brief abstract base class for a general raw data channel
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-09-27
  \date 2021-09-27 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date        <th>Author      <th>Description                    </tr>
  <tr>  <td>2021-09-27   <td>Asia Sun    <td>file created                   </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFRawChannel_h
#define ETFRawChannel_h

#include <cstdlib>
#include "TObject.h"

class ETFRawChannel : public TObject{
public:
  ETFRawChannel();
  ETFRawChannel(const ETFRawChannel &ch);
  virtual ~ETFRawChannel();

  void SetChannelId(Int_t chId){ fChannelId = chId; }
  void SetIsPXI(bool opt){ fIsPXI = opt; }

  int GetChannelId() const{ return fChannelId; }
  int GetChId() const{ return fChannelId; }
  virtual void Initialize() = 0;
  virtual void Print() const = 0;
  bool IsPXI(){ return fIsPXI; }

  virtual void Reset(){ fChannelId = -1; }

  /// bit smoothing, imported from BUAA code: uniform distribution: (0,1)
  static double rand0_1(){ return rand()*1./RAND_MAX; }

  ClassDef(ETFRawChannel, 1); // virtual class for raw data channels

protected:
  int fChannelId; ///< channel id
  bool fIsPXI; ///< whether its a PXI channel
};

#endif
